import React,{useState,useEffect} from 'react'
import { Tabs } from 'antd';
import ActivityTable from './activity_table'
export default function makeActivity() {
  const [stateType,setStateType] = useState(0)
const { TabPane } = Tabs;
const state  = [
  {
    value:0,
    label:'全部'
  },
  {
    value:1,
    label:'待审核'
  },
  {
    value:2,
    label:'进行中'
  },
  {
    value:3,
    label:'未开始'
  },
  {
    value:4,
    label:'已驳回'
  },
  {
    value:5,
    label:'草稿箱'
  },
  {
    value:6,
    label:'已结束'
  }
]
function callback(key:any) {
  setStateType(key)
}
  return (
    <div style={{padding:'20px',margin:'10px'}}>
        <Tabs defaultActiveKey="0" onChange={callback}>
          {state.map(el =>{
            return <TabPane tab={el.label} key={el.value}>
               <ActivityTable state={state} type={stateType}/>
            </TabPane>
          })}
        </Tabs>
    </div>
  )
}
